package com.example.xiaomiao.DTO;

import com.example.xiaomiao.DO.User;
import lombok.Data;

import static com.example.xiaomiao.Util.MyConstants.BASE_URL;

@Data
public class UserGetResponseDTO {
    int user_id;
    String telephone;
    String password;
    String nickname;
    int gender;
    String profile_picture;

    public UserGetResponseDTO(User user){
        this.user_id = user.getUser_id();
        this.telephone = user.getTelephone();
        this.password = user.getPassword();
        this.nickname = user.getNickname();
        this.gender = user.getGender();
        this.profile_picture = user.getProfile_picture()!=0 ? BASE_URL + "/picture/" + user.getProfile_picture() + ".jpg" : null;
    }
}
